package cate.game.role.res.farm.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBFarms;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "一键种植的请求")
@OperationSetter(value = GDOperation.FARM_FAST_PLANT, sub = "seedType")
public class FarmsFastPlantReq implements MsgInput {
    @NoteField("种子类型")
    public byte seedType;
    @NoteField("种子等级")
    public int seedLevel;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = cc.getRole().getRes().farm.fastPlant(seedType, seedLevel);
        game.notice.message(cc.getRole(), r, true);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBFarms.FAST_PLANT_REQ;
    }
}
